package com.sharp.join.tk.mybatis.dao.entity;

import com.sharp.join.tk.mybatis.framework.join.anno.JoinCollection;
import com.sharp.join.tk.mybatis.framework.join.entity.IJoinRelationship;
import com.sharp.join.tk.mybatis.framework.join.entity.JoinRelationship;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Table;
import java.util.List;

/**
 * Title: SchoolTeacherJoin
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2022/7/18 11:47
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SchoolTeacherJoin extends TestSchool implements IJoinRelationship {
    @JoinCollection
    private List<ClassTeacherJoin> classTeacherJoinList;

    @Override
    public List<JoinRelationship> joinRelationship() {
        return buildJoinRelationship(TestClass.class, "schoolId", TestSchool.class, "id", JoinRelationship.Type.LEFT_JOIN)
                .add(TestClass.class, "id", TestTeacher.class, "classId", JoinRelationship.Type.LEFT_JOIN)
                .build();
    }
}
